<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015-11-17-0017
 * Time: 10:01
 */
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 15-9-23
 * Time: 下午2:13
 */

class NewscateModel extends BaseModel
{
    private $_table;
    protected $_name = 'news_cate';
    protected $_isbug = false;

    public function __construct() {
        parent::__construct();
    }

    public function NewsTpye(){
        $this->_table = new self ();
        $db = $this->_table->getAdapter ();
        $sql = $db->select ()->from ( $this->_name,array("id","cate_name"))
            ->where("is_show='Y'")
            ->__toString ();
        if ($this->_isbug == true) {
            echo  __METHOD__.": ".$sql . "<hr/>";
        }
        return $db->fetchAll($sql);
    }
}